package com.tool;

import cn.hutool.core.util.ArrayUtil;

public class ToolHex {

    private static final char[] hexChars = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f', 'A', 'B', 'C', 'D', 'E', 'F'};

    /**
     * 判断是否为16禁止字串
     * @param str
     * @return
     */
    public static boolean isHexNumber(String str) {
        for (int i = 0; i < str.length(); i++) {
            if (!ArrayUtil.contains(hexChars, str.charAt(i))) {
                return false;
            }
        }
        return true;
    }
}
